public class WhileLoop {
    public static void main(String[] args) {
        // 基本 while 循环
        int count = 1;
        while (count <= 5) {
            System.out.println("计数: " + count);
            count++;
        }
        
        // 使用 while 计算阶乘
        int number = 5;
        int factorial = 1;
        int i = 1;
        while (i <= number) {
            factorial *= i;
            i++;
        }
        System.out.println(number + "的阶乘是: " + factorial);
    }
}
